class Student:
    def __init__(self, name, sex, age, score):
        self.name = name
        self.sex = sex
        self.age = age
        self.score = score
        self.id = self.get_id()


    # 获取对象的内存地址
    def get_id(self):
        return id(self)

    # 打印学生信息
    def info(self):
        print(f'id:{self.id} ,姓名：{self.name}，性别：{self.sex}，年龄：{self.age}，成绩：{self.score}')


if __name__ == '__main__':
    students = list()
    print("请分别输入学生信息}")
    for i in range(1, 2):
        name = input(f"请输入第{i}名学生姓名：")
        sex = input(f"请输入第{i}名学生性别：")
        age = int(input(f"请输入第{i}名学生年龄："))
        score = eval(input(f"请输入第{i}名学生成绩："))
        student = Student(name, sex, age, score)
        students.append(student)

    # 打印列表中的学生信息
    for item in students:
        item.info()
